package com.tian.controller;

import com.tian.util.CommonResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author tianwc  公众号：java后端技术全栈、面试专栏
 * @version 1.0.0
 * @date 2023年06月20日 08:56
 * 博客地址：<a href="http://woaijava.cc/">博客地址</a>
 * <p>
 * 充电桩充电
 */
@RestController
@RequestMapping("/station/charge")
public class ChargeController {

    /**
     * 开启充电服务
     */
    @PostMapping(value = "/startServer")
    public CommonResult startService() {
        return null;
    }

    /**
     * 关闭充电服务
     */
    @PostMapping(value = "/stopServer")
    public CommonResult stopService() {
        return null;
    }

    /**
     * 开始充电
     *
     * @param staTime  开始时间
     * @param endTime  结束时间
     * @param chargeId 充电桩id
     * @param userId   用户id
     * @param flag     即时充电-开启，状态为1。(默认为1)
     * @return
     */
    @PostMapping(value = "/startOrder")
    public CommonResult startOrder(@RequestParam(value = "staTime", required = false) String staTime,
                                   @RequestParam(value = "endTime", required = false) String endTime,
                                   @RequestParam(value = "chargeId") String chargeId,
                                   @RequestParam(value = "userId") String userId,
                                   @RequestParam(value = "flag", defaultValue = "1") String flag) {
        return null;
    }

    /**
     * 停止充电
     *
     * @param chargeId 充电桩id
     * @param userId   用户id
     * @param flag     即时充电-停止，状态为1
     * @return
     */
    @PostMapping(value = "/stopCharge")
    public CommonResult stopCharge(@RequestParam(value = "chargeId") Integer chargeId,
                                   @RequestParam(value = "userId") Long userId,
                                   @RequestParam(value = "flag", defaultValue = "1") String flag) {
        return null;
    }
}
